
Define Constants

Syntax:	#A0
Value :	0, 0x00
Effect:	analog channel A0 (multiplexed with digital channel D4)

Syntax:	#A1
Value :	1, 0x01
Effect:	analog channel A1 (multiplexed with digital channel D5)

Syntax:	#A2
Value :	2, 0x02
Effect:	analog channel A2

Syntax:	#A3
Value :	3, 0x03
Effect:	analog channel A3

Syntax:	#D0
Value :	0, 0x00
Effect:	digital channel D0

Syntax:	#D1
Value :	1, 0x01
Effect:	digital channel D1

Syntax:	#D2
Value :	2, 0x02
Effect:	digital channel D2

Syntax:	#D3
Value :	3, 0x03
Effect:	digital channel D3

Syntax:	#D4
Value :	4, 0x04
Effect:	digital channel D4 (multiplexed with analog channel A0)

Syntax:	#D5
Value :	5, 0x05
Effect:	digital channel D5 (multiplexed with analog channel A1)

Syntax:	#defaultExecMode
Value :	0, 0x00
Effect:	use the system default execution mode (restart on HALT)

Syntax:	#defaultPriority
Value :	65535, 0xFFFF
Effect:	use the system default execution priority

Syntax:	#errorOverFlowUART
Value :	2, 0x02
Effect:	there was a receive (Rx) serial port input pipe overflow error

Syntax:	#errorOverRunUART
Value :	1, 0x01
Effect:	there was a receive (Rx) overrun error on the serial port

Syntax:	#errorUnderFlowUART
Value :	4, 0x04
Effect:	there was a receive (Rx) serial port input pipe underflow error

Syntax:	#execModeNoRestart
Value :	1, 0x01
Effect:	use the no-restart execution mode (no restart on HALT)

Syntax:	#fileNamePipe
Value :	16, 0x10
Effect:	a pipe used to set the file name for the script's log file

Syntax:	#filePipe
Value :	16384, 0x4000
Effect:	the log file pipe for the script

Syntax:	#highIO
Value :	1, 0x01
Effect:	a high level on the IO pin

Syntax:	#inputIO
Value :	1, 0x01
Effect:	indicates the IO pin is to be opened as an input

Syntax:	#interruptRxUART
Value :	8, 0x08
Effect:	enables interrupt receive on the serial port (system limited)

Syntax:	#lowIO
Value :	0, 0x00
Effect:	a low level on the IO pin

Syntax:	#matchUARTString
Value :	26, 0x1A
Effect:	print function constant, displays the contents of the NMEA 
	string schema to use to match NMEA sentences received on the serial 
	pipe buffer

Syntax:	#maxUARTRxSize
Value :	96, 0x60
Effect:	the maximum capacity of the serial port input pipe buffer

Syntax:	#nmea
Value :	10, 0x0A
Effect:	print function constant, displays the NMEA end sentence 
	sequence, including CRC, useful for sending NMEA sentences

Syntax:	#noGPSDecodingUART
Value :	64, 0x40
Effect:	disable automatic NMEA sentence decoding on the serial port 
	input (GPS GPRMC sentence decoding)

Syntax:	#noPause
Value :	0, 0x00
Effect:	used to unpause a script

Syntax:	#noRxInvUART
Value :	2, 0x02
Effect:	do not invert the receive (Rx) pin input for the serial port

Syntax:	#noRxUART
Value :	32, 0x20
Effect:	disables receive (Rx) on the serial port (UART)

Syntax:	#noTxInvUART
Value :	1, 0x01
Effect:	do not invert the transmit (Tx) pin output for the serial port

Syntax:	#noTxUART
Value :	16, 0x10
Effect:	disables transmit (Tx) on the serial port (UART)

Syntax:	#noUART
Value :	128, 0x80
Effect:	disables the serial port function (UART)

Syntax:	#oneWireOverDrive
Value :	32, 0x20
Effect:	use over drive speeds on the OneWire bus

Syntax:	#oneWireRead
Value :	1, 0x01
Effect:	select read direction for the OneWire bus

Syntax:	#oneWireStrongPullUp
Value :	4, 0x04
Effect:	enable a strong pull up on the OneWire bus

Syntax:	#oneWireUsingIO
Value :	16, 0x10
Effect:	use a digital IO pin for the OneWire bus implementation

Syntax:	#oneWireUsingUART
Value :	0, 0x00
Effect:	use the serial port for the OneWire bus implementation

Syntax:	#oneWireWrite
Value :	2, 0x02
Effect:	select write direction for the OneWire bus

Syntax:	#openDrainUART
Value :	4, 0x04
Effect:	enables open drain output for the transmit (Tx) pin on the 
	serial port

Syntax:	#outputIO
Value :	0, 0x00
Effect:	indicates the IO pin is to be opened as an output

Syntax:	#pause
Value :	128, 0x80
Effect:	used to pause a script

Syntax:	#pi
Value :	3.14159
Effect:	the mathematical constant PI, useful for trigonometric 
	functions, among other uses

Syntax:	#pipeUART
Value :	25, 0x19
Effect:	print function constant, displays the contents of the input 
	serial pipe buffer

Syntax:	#serialPipe
Value :	32768, 0x8000
Effect:	the serial pipe over the script's serial port

Syntax:	#showDay
Value :	1, 0x01
Effect:	display the day of the month

Syntax:	#showDefault
Value :	127, 0x7F
Effect:	display the system default time settings

Syntax:	#showHours
Value :	16, 0x10
Effect:	display the hours

Syntax:	#showMinutes
Value :	4, 0x04
Effect:	display the minutes

Syntax:	#showMonth
Value :	32, 0x20
Effect:	display the month

Syntax:	#showSeconds
Value :	8, 0x08
Effect:	display the seconds

Syntax:	#showWeekDay
Value :	2, 0x02
Effect:	display the day of the week

Syntax:	#showYear
Value :	64, 0x40
Effect:	display the year

Syntax:	#systemLogPipe
Value :	4096, 0x1000
Effect:	a pipe used to log entries to the system log file

Syntax:	#time
Value :	1, 0x01
Effect:	print function constant, displays the local time

Syntax:	#timeDuration
Value :	8, 0x08
Effect:	print function constant, displays the duration since the time 
	was last synchronised with the PC Host

Syntax:	#timeFileName
Value :	3, 0x03
Effect:	print function constant, displays the local time as a string 
	suitable for a file name

Syntax:	#timeFileNameDate
Value :	4, 0x04
Effect:	print function constant, displays the local date as a string 
	suitable for a file name

Syntax:	#timeFileNameNumeric
Value :	5, 0x05
Effect:	print function constant, displays the local time as a numeric 
	string suitable for a file name

Syntax:	#timeFileNameNumericDate
Value :	6, 0x06
Effect:	print function constant, displays the local date as a numeric 
	string suitable for a file name

Syntax:	#timeIfSet
Value :	2, 0x02
Effect:	print function constant, displays the local time if it is set

Syntax:	#timeOrDuration
Value :	7, 0x07
Effect:	print function constant, displays the local time if it is set 
	or the duration since the last POR (Power On Reset)

Syntax:	#usbPipe
Value :	8192, 0x2000
Effect:	a serial pipe emulated over the USB connection to the PC Host

Syntax:	#vmFileName
Value :	11, 0x0B
Effect:	print function constant, displays the script's log's file name

Syntax:	#vmTime
Value :	17, 0x11
Effect:	print function constant, displays the script's time register

Syntax:	#vmTimeDuration
Value :	24, 0x18
Effect:	print function constant, displays the duration since the script 
	was last restarted

Syntax:	#vmTimeFileName
Value :	19, 0x13
Effect:	print function constant, displays the script's time as a string 
	suitable for a file name

Syntax:	#vmTimeFileNameDate
Value :	20, 0x14
Effect:	print function constant, displays the script's date as a string 
	suitable for a file name

Syntax:	#vmTimeFileNameNumeric
Value :	21, 0x15
Effect:	print function constant, displays the script's time as a 
	numeric string suitable for a file name

Syntax:	#vmTimeFileNameNumericDate
Value :	22, 0x16
Effect:	print function constant, displays the script's date as a 
	numeric string suitable for a file name

Syntax:	#vmTimeFuture
Value :	9, 0x09
Effect:	print function constant, displays the next matching time 
	argument in the future corresponding to the script's time register

Syntax:	#vmTimeIfSet
Value :	18, 0x12
Effect:	print function constant, displays the script's time register if 
	it is set

Syntax:	#vmTimeOrDuration
Value :	23, 0x17
Effect:	print function constant, displays the script's time if it is 
	set or the duration since the script was last restarted


Header Objects

Syntax:	execMode
Effect:	set this to override the default execution mode of the script, 
	which restarts automatically if it halts, possible values include: 
	#defaultExecMode, #execModeNoRestart

Syntax:	execPriority
Effect:	set this to override the default execution priority of the 
	script (the higher the number, the more priority), the default is: #defaultPriority


Global Functions

Syntax:	@@acos($1)
Effect:	returns the arc cosine of $1 if $1 is between -1 and +1, 
	otherwise 0

Syntax:	@@addDays($1, $2)
Effect:	if only one argument is given, add $1>0 days to the local time, 
	otherwise if $2==#vmTime, add $1 days to the script's time

Syntax:	@@addHours($1, $2)
Effect:	if only one argument is given, add $1>0 hours to the local 
	time, otherwise if $2==#vmTime, add $1 hours to the script's time

Syntax:	@@addMinutes($1, $2)
Effect:	if only one argument is given, add $1>0 minutes to the local 
	time, otherwise if $2==#vmTime, add $1 minutes to the script's time

Syntax:	@@addMonths($1, $2)
Effect:	if only one argument is given, add $1>0 months to the local 
	time, otherwise if $2==#vmTime, add $1 months to the script's time

Syntax:	@@addSeconds($1, $2)
Effect:	if only one argument is given, add $1>0 seconds to the local 
	time, otherwise if $2==#vmTime, add $1 seconds to the script's time

Syntax:	@@asin($1)
Effect:	returns the arc sine of $1 if $1 is between -1 and +1, 
	otherwise 0

Syntax:	@@atan($1)
Effect:	returns the arc tangent of $1

Syntax:	@@bcdToDecimal($1)
Effect:	returns the decimal equivalent of the BCD value $1

Syntax:	@@calibrateADC()
Effect:	perform an automatic, real time calibration of the ADC system

Syntax:	@@clearUART()
Effect:	clears the serial port input pipe

Syntax:	@@closeADC($1)
Effect:	close pin $1 as analog input

Syntax:	@@closeCapture($1)
Effect:	close the frequency or counter input on pin $1

Syntax:	@@closeI2C()
Effect:	closes the I2C bus

Syntax:	@@closeIO($1)
Effect:	close the digital IO pin $1

Syntax:	@@closeOneWire()
Effect:	close the OneWire bus

Syntax:	@@closeSPI()
Effect:	closes the SPI bus

Syntax:	@@closeUART()
Effect:	closes the serial port

Syntax:	@@copyOneWireBufferToRomCodeBuffer($1)
Effect:	fill the rom code buffer with the contents of the one wire 
	buffer at offset $1

Syntax:	@@copyRomCodeBufferToOneWireBuffer($1)
Effect:	copy the contents of the rom code buffer to the one wire buffer 
	at offset $1

Syntax:	@@cos($1)
Effect:	returns the cosine of the angle (in radians)

Syntax:	@@decimalToBcd($1)
Effect:	returns the BCD equivalent of decimal value $1

Syntax:	@@exp($1)
Effect:	returns the value of e to the power of $1, where e is the 
	natural constant

Syntax:	@@flashLED($1)
Effect:	flash the onboard LED (LED3) on $1 times (system limited)

Syntax:	@@flashLEDDuration($1, $2)
Effect:	flash the onboard LED (LED3) on $1 times for $2 ms each time 
	(system limited)

Syntax:	@@frac($1)
Effect:	returns the fractional part of $1

Syntax:	@@gcd($1, $2)
Effect:	returns the greatest common divisor of $1 and $2

Syntax:	@@getADCRef()
Effect:	compute the ADC reference voltage by measuring (in real time) 
	the internal band gap reference voltage

Syntax:	@@getADCRefIfVBGVEquals($1)
Effect:	return the ADC reference voltage if the voltage of the band gap 
	reference (VBG) is $1

Syntax:	@@getADCSupplyRef()
Effect:	get the ADC reference voltage

Syntax:	@@getDay($1)
Effect:	if $1 is not given, get the day of the local time from the RTCC 
	(Real Time Clock Calendar), otherwise if $1==#vmTime, get the day of 
	the script's time

Syntax:	@@getDaysInMonthYear($1, $2)
Effect:	if no arguments are given, returns the number of days in the 
	local time's month, otherwise returns the number of days in year $2 
	and month $1

Syntax:	@@getErrorUART()
Effect:	return the serial port input error register and then clear any 
	error. The error register can be a combination of the following 
	constants: #errorOverRunUART, #errorOverFlowUART, #errorUnderFlowUART 

Syntax:	@@getHour($1)
Effect:	if $1 is not given, get the (24 hour time) hour of the local 
	time from the RTCC (Real Time Clock Calendar), otherwise if 
	$1==#vmTime, get the hours of the script's time

Syntax:	@@getI2C($1, $2)
Effect:	reads up to $2 bytes from I2C address $1 (into the $$I2C buffer)

Syntax:	@@getI2CTwoBytes($1)
Effect:	reads 2 bytes from I2C address $1 (into the $$I2C buffer)

Syntax:	@@getIO($1)
Effect:	get the level of the digital input pin on $1

Syntax:	@@getLastRxUART()
Effect:	returns the last received character from the serial port

Syntax:	@@getLocalTime()
Effect:	load the script's time register with the local time from the 
	RTCC (Real Time Clock Calendar)

Syntax:	@@getMinutes($1)
Effect:	if $1 is not given, get the minutes of the local time from the 
	RTCC (Real Time Clock Calendar), otherwise if $1==#vmTime, get the 
	minutes of the script's time

Syntax:	@@getMonth($1)
Effect:	if $1 is not given, get the month of the local time from the 
	RTCC (Real Time Clock Calendar), otherwise if $1==#vmTime, get the 
	month of the script's time

Syntax:	@@getPipes()
Effect:	return the currently enabled pipes. The result can be a 
	combination of the following: #serialPipe, #filePipe, #usbPipe, 
	#fileNamePipe, #systemLogPipe 

Syntax:	@@getSeconds($1)
Effect:	if $1 is not given, get the seconds of the local time from the 
	RTCC (Real Time Clock Calendar), otherwise if $1==#vmTime, get the 
	seconds of the script's time

Syntax:	@@getSizeUART()
Effect:	returns the current size of serial port input pipe

Syntax:	@@getTotalSeconds($1)
Effect:	if no argument is given, return the total number of seconds 
	from the default time (1 Jan 2011 00:00:00) until the local time, 
	otherwise if $1==#vmTime, from the default time to the script's time

Syntax:	@@getTotalSecondsDiv($1, $2)
Effect:	if one argument is given, return the total number of seconds 
	from the default time (1 Jan 2011 00:00:00) until the local time 
	divided by $1>0, otherwise if $2==#vmTime, from the default time to 
	the script's time divided by $1>0

Syntax:	@@getTotalSecondsMod($1, $2)
Effect:	if no argument is given, return the total number of seconds 
	from the default time (1 Jan 2011 00:00:00) until the local time 
	modulo $1>0, otherwise if $2==#vmTime, from the default time to the 
	script's time modulo $1>0

Syntax:	@@getUART()
Effect:	reads a character from the serial port input pipe, if 
	available, otherwise 0

Syntax:	@@getWeekDay($1)
Effect:	if no argument is given, return the week day of the local time, 
	otherwise if $1==#vmTime, return the week day of the script's time 
	(0=Monday, ..., 6=Sunday)

Syntax:	@@getYear($1)
Effect:	if $1 is not given, get the year of the local time from the 
	RTCC (Real Time Clock Calendar), otherwise if $1==#vmTime, get the 
	year of the script's time

Syntax:	@@initRandom($1, $2)
Effect:	initialises the pseudo random generator modulo $1 and with seed 
	$2, returns $2 modulo $1

Syntax:	@@int($1)
Effect:	returns the integer part of $1

Syntax:	@@isIOHigh($1)
Effect:	returns 1 if the digital IO pin $1 is high, otherwise 0

Syntax:	@@isIOLow($1)
Effect:	returns 1 if the digital IO pin $1 is low, otherwise 0

Syntax:	@@isLeapYear($1)
Effect:	if no argument is given, return 1 if the local time's year is a 
	leap year, otherwise return 1 if $1 is a leap year, otherwise 0

Syntax:	@@isPrime($1)
Effect:	returns 1 if $1 is prime, 0 otherwise

Syntax:	@@ln($1)
Effect:	returns the natural log of $1, if $1 > 0, otherwise 0

Syntax:	@@log10($1)
Effect:	returns the log base 10 of $1, if $1 > 0, otherwise 0

Syntax:	@@matchNMEAString()
Effect:	returns 1 if a NMEA sentence has been received on the serial 
	port input pipe and it matches the one last set using the built in 
	matchNMEA command

Syntax:	@@notEmptyUART()
Effect:	returns 1 if the serial port input pipe is not empty, otherwise 0

Syntax:	@@numDivisors($1)
Effect:	returns the number of divisors of $1

Syntax:	@@oneWireCRC($1)
Effect:	return the OneWire CRC of the $$oneWire buffer of up to $1 bytes

Syntax:	@@openADC($1)
Effect:	configure pin $1 as analog input

Syntax:	@@openCapture($1, $2)
Effect:	open pin $1 as a frequency/counter input in mode $2

Syntax:	@@openCaptureHighFrequency($1)
Effect:	open pin $1 as a high frequency input

Syntax:	@@openFallingCounter($1)
Effect:	open pin $1 as a counter input incrementing on a falling edge 
	(also clears the counter)

Syntax:	@@openFrequency($1)
Effect:	open pin $1 as a frequency input (with automatic scaling of 
	frequency modes)

Syntax:	@@openI2C($1)
Effect:	opens the I2C bus running at $1 kHz

Syntax:	@@openIO($1, $2)
Effect:	open a digital IO pin on pin $1 and set to input (if 
	$2==#inputIO==1) of output (if $2==#outputIO==0)

Syntax:	@@openLowFrequency($1)
Effect:	open pin $1 as a low frequency input

Syntax:	@@openMediumFrequency($1)
Effect:	open pin $1 as a medium frequency input

Syntax:	@@openOneWire($1, $2)
Effect:	open the OneWire bus in mode $1 on pin $2. The mode can be a 
	combination of: #oneWireUsingUART, #oneWireUsingIO, #oneWireOverDrive, 
	#oneWireWrite, #oneWireRead, #oneWireStrongPullUp 

Syntax:	@@openRisingCounter($1)
Effect:	open pin $1 as a counter input incrementing on a rising edge 
	(also clears the counter)

Syntax:	@@openSPI($1, $2, $3, $4, $5)
Effect:	opens the SPI bus in mode $1, with CLK pin $2, DI pin $3, DO 
	pin $4, CS pin $5

Syntax:	@@openUART($1, $2, $3, $4)
Effect:	opens the serial port in mode $1, baud rate $2 with Tx pin $3 
	and Rx pin $4. The mode can be a combination of the following 
	constants: #noTxInvUART, #noRxInvUART, #openDrainUART, 
	#interruptRxUART, #noTxUART, #noRxUART,	#noGPSDecodingUART, 
	#noUART 

Syntax:	@@pauseVM($1)
Effect:	pause (if ($1 & #pause)!=0) or unpause (if ($1 & #noPause)!=0) 
	the script with ID $1

Syntax:	@@primeProduct($1)
Effect:	returns the product of the prime divisors of $1

Syntax:	@@putI2C($1, $2)
Effect:	writes up to $2 bytes to I2C address $1 (from the $$I2C buffer)

Syntax:	@@putI2CByte($1, $2)
Effect:	writes byte $2 to I2C address $1

Syntax:	@@putI2CTwoBytes($1, $2, $3)
Effect:	writes bytes $2 and $3 to I2C address $1

Syntax:	@@putUART($1)
Effect:	writes a character to the serial port

Syntax:	@@readADC($1)
Effect:	return the voltage level in Volts at the input to the 
	microcontroller corresponding to analog input pin $1

Syntax:	@@readADCP()
Effect:	return the voltage level in Volts at the input to REG1 the 
	boost regulator

Syntax:	@@readComparator()
Effect:	get the output state of the internal comparator (connected to S2)

Syntax:	@@readCounter($1)
Effect:	return the value of the counter on the pin $1 counter input

Syntax:	@@readEE($1)
Effect:	return the value of the byte of general non volatile memory at 
	address $1 (EEPROM emulated on memory card)

Syntax:	@@readEEFloat($1)
Effect:	return the 32 bit floating point value of general non volatile 
	memory at address $1 (EEPROM emulated on memory card)

Syntax:	@@readFrequency($1)
Effect:	return the frequency of the signal on the pin $1 frequency input

Syntax:	@@readV($1)
Effect:	return the voltage level in Volts at the analog input pin $1 
	(assuming the default voltage dividers have been used)

Syntax:	@@receivedNMEAUART()
Effect:	returns 1 if a valid NMEA sentence has been received on the 
	serial port input pipe, otherwise 0

Syntax:	@@resetOneWire()
Effect:	send a reset pulse to the OneWire bus

Syntax:	@@rnd($1)
Effect:	returns a pseudo random number modulo $1

Syntax:	@@sendOneWireCommand($1, $2, $3, $4)
Effect:	send the command $1, with data packet of $2 bits, in mode $3 
	and with optional $4 ms pullup to the OneWire bus

Syntax:	@@sendOneWireCommandRomCode($1, $2, $3, $4)
Effect:	send the command $1, with data packet of $2 bits, in mode $3 
	and with optional $4 ms pullup to the OneWire bus (Uses the Rom Code 
	Buffer As Buffer)

Syntax:	@@setADCSupplyRef($1)
Effect:	set the ADC reference voltage to $1, provided it is within 
	reasonable bounds

Syntax:	@@setDay($1, $2)
Effect:	if only one argument is given, set the day of the local time to 
	$1, otherwise if $2==#vmTime, set the day of the script's time to $1

Syntax:	@@setHour($1, $2)
Effect:	if only one argument is given, set the (24 hour time) hour of 
	the local time to $1, otherwise if $2==#vmTime, set the year of the 
	script's time to $1

Syntax:	@@setIO($1, $2)
Effect:	set the digital output pin on pin $1 to high (if 
	$2==#highIO==1) or low (if $2==#lowIO==0)

Syntax:	@@setLED($1)
Effect:	set the onboard LED (LED3) on for $1 ms (system limited)

Syntax:	@@setLocalTime($1)
Effect:	set the RTCC (Real Time Clock Calendar) clock with the script's 
	time register or the argument $1 in the form time(YYYY:MM:DD:hh:mm:ss)

Syntax:	@@setMinutes($1, $2)
Effect:	if only one argument is given, set the minutes of the local 
	time to $1, otherwise if $2==#vmTime, set the year of the script's 
	time to $1

Syntax:	@@setMonth($1, $2)
Effect:	if only one argument is given, set the month of the local time 
	to $1, otherwise if $2==#vmTime, set the month of the script's time to $1

Syntax:	@@setSPICS($1)
Effect:	set the SPI bus' CS line to $1

Syntax:	@@setScriptTime($1)
Effect:	set the script's time register, the argument $1 can be a time 
	in the form time(YYYY:MM:DD:hh:mm:ss)

Syntax:	@@setSeconds($1, $2)
Effect:	if only one argument is given, set the seconds of the local 
	time to $1, otherwise if $2==#vmTime, set the year of the script's 
	time to $1

Syntax:	@@setShowScriptTime($1)
Effect:	set the show mode for the script's time register, where $1 is a 
	combination of the following constants: #showDay, #showWeekDay, 
	#showMinutes, #showSeconds, #showHours, #showMonth, #showYear, #showDefault	

Syntax:	@@setTotalSeconds($1, $2)
Effect:	if only one argument is given, set the local time to the number 
	of seconds $1 from the default time (1 Jan 2011 00:00:00), otherwise 
	if $2==#vmTime, set the script's time at $1 seconds from the default time

Syntax:	@@setTotalSecondsDivMod($1, $2, $3, $4)
Effect:	if only three arguments are given, set the local time to the 
	number of seconds equal to (($1*$2)+$3) from the default time (1 Jan 
	2011 00:00:00), otherwise if $4==#vmTime, set the script's time at 
	(($1*$2)+$3) seconds from the default time

Syntax:	@@setVBGPinIO($1)
Effect:	if $1==1 enable the band gap reference voltage on the D5/A1 
	output pin, if $1==0 disable such output

Syntax:	@@setYear($1, $2)
Effect:	if only one argument is given, set the year of the local time 
	to $1, otherwise if $2==#vmTime, set the year of the script's time to $1

Syntax:	@@sin($1)
Effect:	returns the sine of the angle (in radians)

Syntax:	@@sizeEE()
Effect:	get the size in bytes of the general non volatile memory 
	(EEPROM emulated on memory card)

Syntax:	@@sqrt($1)
Effect:	returns the square root of $1

Syntax:	@@startVM($1)
Effect:	add the script with ID $1 to the VM environment (start the script)

Syntax:	@@stopVM($1)
Effect:	remove the script with ID $1 from the VM environment (stop the script)

Syntax:	@@sum($1, $2)
Effect:	returns the sum of $2 numbers starting at address $1, if $2 is 
	between 0 and 65535, otherwise 0

Syntax:	@@sumSquares($1, $2)
Effect:	returns the sum of the squares of $2 numbers starting at 
	address $1, if $2 is between 0 and 65535, otherwise 0

Syntax:	@@sysRead($1)
Effect:	return the value of the byte of system memory at address $1

Syntax:	@@sysReadFloat($1)
Effect:	return the 32 bit floating point value of system memory at 
	address $1

Syntax:	@@sysWrite($1, $2)
Effect:	write the byte $2 to system memory address $1

Syntax:	@@sysWriteFloat($1, $2)
Effect:	write the 32 bit floating point value $2 to system memory 
	address $1

Syntax:	@@tan($1)
Effect:	returns the tangent of the angle (in radians)

Syntax:	@@toggleIO($1)
Effect:	toggle the level of the IO pin $1

Syntax:	@@writeEE($1, $2)
Effect:	write the byte $2 to general non volatile memory at address $1 
	(EEPROM emulated on memory card)

Syntax:	@@writeEEFloat($1, $2)
Effect:	write the 32 bit floating point value $2 to general non 
	volatile memory at address $1 (EEPROM emulated on memory card)

Syntax:	@@writeSPI($1)
Effect:	write $1 to the SPI bus, simultaneously return the value read 
	from the SPI bus

Syntax:	@@writeSPINoCS($1)
Effect:	write $1 to the SPI bus without asserting CS, simultaneously 
	return the value read from the SPI bus


Global Variables

Syntax:	$$I2C
Effect:	the I2C internal buffer

Syntax:	$$SPI
Effect:	the SPI buffer

Syntax:	$$cache.file
Effect:	base pointer to the FILE cache of the current script

Syntax:	$$cache.ram
Effect:	base pointer to the RAM cache of the current script

Syntax:	$$cache.rom
Effect:	base pointer to the ROM cache of the current script

Syntax:	$$cache.stack
Effect:	base pointer to the STACK cache of the current script

Syntax:	$$course
Effect:	32 bit floating point value indicating course over ground 
	(heading) in degrees set by the system if a GPS module is present and 
	outputting valid GPS GPRMC NMEA sentences through the serial port

Syntax:	$$file
Effect:	the memory mapped log file output for the VM

Syntax:	$$fileName
Effect:	the current script's log file name buffer

Syntax:	$$hardware
Effect:	base pointer to the hardware descriptors of the current script

Syntax:	$$hardware.I2C
Effect:	base pointer to the hardware descriptor for the I2C port of the 
	current script

Syntax:	$$hardware.I2C.busRate
Effect:	the current bus rate (in kHz) of the I2C port of the current script

Syntax:	$$hardware.SPI
Effect:	base pointer to the hardware descriptor for the SPI port of the 
	current script

Syntax:	$$hardware.SPI.ckdidocspin
Effect:	the CLK, DI, DO and CS pin register of the SPI port of the 
	current script

Syntax:	$$hardware.SPI.mode
Effect:	the current mode of the SPI port of the current script

Syntax:	$$hardware.oneWire
Effect:	base pointer to the hardware descriptor for the oneWire port of 
	the current script

Syntax:	$$hardware.oneWire.mode
Effect:	the current mode of the oneWire port of the current script

Syntax:	$$hardware.oneWireSerial
Effect:	base pointer to the hardware descriptor for the serial port of 
	oneWire port of the current script

Syntax:	$$hardware.oneWireSerial.baudRate
Effect:	the baud rate (divided by 10) of the serial port of the oneWire 
	port of current script

Syntax:	$$hardware.oneWireSerial.mode
Effect:	the current mode of the serial port of the oneWire port of the 
	current script

Syntax:	$$hardware.oneWireSerial.txrxpin
Effect:	the Tx and Rx pin register of the serial port of the oneWire 
	port of current script

Syntax:	$$hardware.serial
Effect:	base pointer to the hardware descriptor for the serial port of 
	the current script

Syntax:	$$hardware.serial.baudRate
Effect:	the baud rate (divided by 10) of the serial port of the current script

Syntax:	$$hardware.serial.mode
Effect:	the current mode of the serial port of the current script

Syntax:	$$hardware.serial.txrxpin
Effect:	the Tx and Rx pin register of the serial port of the current script

Syntax:	$$indirect
Effect:	indirect memory access to [W]

Syntax:	$$latitude
Effect:	32 bit floating point value indicating latitude in degrees (<0 
	indicates South, >=0 indicates North) set by the system if a GPS 
	module is present and outputting valid GPS GPRMC NMEA sentences 
	through the serial port

Syntax:	$$longitude
Effect:	32 bit floating point value indicating longitude in degrees (<0 
	indicates West, >=0 indicates East) set by the system if a GPS module 
	is present and outputting valid GPS GPRMC NMEA sentences through the 
	serial port

Syntax:	$$nmea.match.string
Effect:	user defined NMEA match string command buffer

Syntax:	$$nmea.match.stringPtr
Effect:	NMEA match string command buffer pointer

Syntax:	$$nmea.output
Effect:	byte array contains the raw output of any NMEA sentence match

Syntax:	$$nmea.outputPtr
Effect:	position pointer to the byte array containing the raw output of 
	any NMEA sentence match (can be used to size the output)

Syntax:	$$oneWire
Effect:	the OneWire internal buffer

Syntax:	$$oneWireRomCode
Effect:	the OneWire Rom Code buffer

Syntax:	$$por
Effect:	is 1 if a POR (Power On Reset) has occurred, otherwise 0

Syntax:	$$return
Effect:	32 bit floating point return value variable, can be used for 
	returning values from local functions

Syntax:	$$serial
Effect:	the serial input pipe buffer

Syntax:	$$serial.RxCRC
Effect:	byte value used to accumulate the CRC checksum for the serial 
	port input pipe buffer (also used for NMEA sentence decoding)

Syntax:	$$serial.TxCRC
Effect:	byte value used to accumulate the CRC checksum for NMEA 
	sentence output

Syntax:	$$serial.error
Effect:	the last error status of the serial input pipe buffer

Syntax:	$$serial.getPtr
Effect:	the serial input pipe buffer read location pointer

Syntax:	$$serial.lastRx
Effect:	the last received character on the serial port

Syntax:	$$serial.pipeState
Effect:	the status of the serial input pipe buffer

Syntax:	$$serial.putPtr
Effect:	the serial input pipe buffer write location pointer

Syntax:	$$speed
Effect:	32 bit floating point value indicating ground speed in knots 
	set by the system if a GPS module is present and outputting valid GPS 
	GPRMC NMEA sentences through the serial port

Syntax:	$$temp
Effect:	temporary buffer (system limited)

Syntax:	$$ven
Effect:	base address of VM environment

Syntax:	$$ven.vmExecLimit
Effect:	VM environment execution limit

Syntax:	$$ven.vmID
Effect:	VM environment script ID buffer

Syntax:	$$ven.vmLogFileCache
Effect:	VM environment log file cache base address

Syntax:	$$ven.vmLogFileName
Effect:	VM environment log file name buffer

Syntax:	$$ven.vmMinimumPeriod
Effect:	VM environment minimum sleep period

Syntax:	$$ven.vmMinimumSleepPeriod
Effect:	VM environment minimum sleep period in seconds

Syntax:	$$ven.vmMode
Effect:	VM environment mode

Syntax:	$$ven.vmNum
Effect:	VM environment number of scripts loaded

Syntax:	$$ven.vmPtr
Effect:	VM environment script pointer

Syntax:	$$ven.vmRecoveryTime
Effect:	VM environment sleep recovery time in seconds

Syntax:	$$ven.vmSelected
Effect:	VM environment selected script

Syntax:	$$ven.vmSleepPeriod
Effect:	VM environment script sleep period

Syntax:	$$ven.vmState
Effect:	VM environment state

Syntax:	$$vm
Effect:	base pointer to the script structure

Syntax:	$$vm.CRC
Effect:	CRC check of the current script

Syntax:	$$vm.DS
Effect:	the DS register of the current script

Syntax:	$$vm.DSLIMIT
Effect:	the DS limit register of the current script

Syntax:	$$vm.IR
Effect:	the instruction register of the current script

Syntax:	$$vm.PC
Effect:	the program counter register of the current script

Syntax:	$$vm.SS
Effect:	the SS register of the current script

Syntax:	$$vm.W
Effect:	the accumulator of the current script

Syntax:	$$vm.addressModes
Effect:	the adressModes of the DS and SS registers of the current script

Syntax:	$$vm.execDone
Effect:	the execution counter register of the current script

Syntax:	$$vm.execID
Effect:	execution ID of the current script

Syntax:	$$vm.execLimit
Effect:	the execution limit register of the current script

Syntax:	$$vm.execMode
Effect:	execution mode of the current script

Syntax:	$$vm.execPriority
Effect:	the execution priority register of the current script

Syntax:	$$vm.execState
Effect:	execution state of the current script

Syntax:	$$vm.lastError
Effect:	last run time error of the current script

Syntax:	$$vm.lastIndirect
Effect:	the last indirect status register of the current script

Syntax:	$$vm.pipeMode
Effect:	the enabled pipes of the current script

Syntax:	$$vm.resetVector
Effect:	the reset vector register of the current script

Syntax:	$$vm.sleepMode
Effect:	the current sleep mode of the current script

Syntax:	$$vm.stackSizePtr
Effect:	the stack size/pointer register of the current script

Syntax:	$$vm.temp
Effect:	N/A

Syntax:	$$vm.tempPipe
Effect:	N/A

Syntax:	$$vm.time
Effect:	base pointer to the script's time register

Syntax:	$$vm.time.day
Effect:	day register of the script's time register

Syntax:	$$vm.time.hours
Effect:	hours register of the script's time register

Syntax:	$$vm.time.mins
Effect:	minutes register of the script's time register

Syntax:	$$vm.time.month
Effect:	month register of the script's time register

Syntax:	$$vm.time.secs
Effect:	seconds register of the script's time register

Syntax:	$$vm.time.show
Effect:	show register of the script's time register (determines which 
	fields of the time are shown)

Syntax:	$$vm.time.updated
Effect:	time updated register of the script's time register

Syntax:	$$vm.time.wday
Effect:	week day register of the script's time register

Syntax:	$$vm.time.year
Effect:	year register of the script's time register

Syntax:	$$vm.timeOffset
Effect:	N/A

Syntax:	$$vm.timeScaling
Effect:	N/A

Syntax:	$$vm.timeSpeed
Effect:	N/A

Syntax:	$$vm.typeMode
Effect:	the implicit argument type register of the current script

